{
	r++;
	rel_r = ($1 >= relevant ? 1 : 0);
	num_relevant_rank_r_or_less += rel_r;
	P_r = num_relevant_rank_r_or_less / r;

	sum += (P_r * rel_r);
}

END {
	print relevant, sum/r;
}